// com/iot/gateway/tsl/qo/ServiceQo.java
package com.iot.gateway.tsl.qo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 设备命令请求 QO
 * 用于接收前端新增/更新设备命令的参数
 *
 * 对应 TSL JSON 中 commands[] 节点
 */
@Data
@Schema(name = "ServiceQo", description = "设备命令请求 QO，包含固定字段和动态扩展字段")
public class ServiceQo {

    @Schema(description = "命令唯一标识符，更新时必填，新增可不填", example = "rebootDevice")
    private String id;

    @Schema(description = "命令名称", required = true, example = "rebootDevice")
    private String name;

    @Schema(description = "命令描述，对应 JSON 字段 \"desc\"", example = "设备远程重启")
    private String desc;

    @Schema(description = "是否必选", example = "true")
    private Boolean required;

    @Schema(description = "调用类型: async（异步）或 sync（同步）", example = "async")
    private String callType;

    @Schema(description = "命令入参列表，对应 JSON 字段 \"inputData\"")
    private List<Map<String, Object>> inputData;

    @Schema(description = "命令出参列表，对应 JSON 字段 \"outputData\"")
    private List<Map<String, Object>> outputData;

    @Schema(description = "命令对应的方法名称，对应 JSON 字段 \"method\"", example = "invokeRebootDevice")
    private String method;

    @Schema(description = "自定义扩展字段，任意键值对，Map 格式", example = "{\"timeout\":60,\"retry\":3}")
    private Map<String, Object> customFields;
}
